﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using CellphoneRepair.Forms;
using CellphoneRepair.UserControls;
using DevExpress.XtraEditors;

namespace CellphoneRepair
{
    public partial class Itmes : DevExpress.XtraEditors.XtraForm
    {
        public Itmes()
        {
            InitializeComponent();
        }

        private void navBarItem1_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
           
        }
        private void LoadForm(Form frm)
        {
            var frms = this.MdiChildren;

            if (frms.Any(o => o.Name.Equals(frm.Name)))
            {
                frms.Single(o => o.Name.Equals(frm.Name)).Activate();

                frm.Dispose();
            }
            else
            {
                frm.MdiParent = this;

                frm.Tag = this;

                frm.Show();
            }
        }

        private void navBarItem1_LinkClicked_1(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
           LoadControl(new uc_Customers());
        }

        private void navBarItem2_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            LoadControl(new Uc_peijian());
        }

        private void LoadControl(UserControl uc)
        {
            splitContainerControl1.Panel2.Controls.Clear();

            uc.Dock = DockStyle.Fill;

            splitContainerControl1.Panel2.Controls.Add(uc);
        }

        private void navBarItem3_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            LoadControl(new EditXinghao());
        }
    }
}